package com.ruisoft.business.stock.bean;

import org.springframework.beans.factory.annotation.Autowired;

import com.ruisoft.base.dao.BaseDao;

import javax.persistence.*;

import java.math.BigDecimal;
import java.sql.Timestamp;

@Entity
@Table(name = "stock_picking_type", schema = "", catalog = "ruisoft")
public class StockPickingType {

    private String id;

    private String name;

    private String code;

    private BigDecimal warehouse_id;

    private String location_src_id;

    private String location_dest_id;

    private String return_picking_type_id;

    private String create_uid;

    private String create_date;

    private String write_uid;

    private String write_date;
    //目的库位
    private String destLocation;
    private String warehouseId;
    private String locationSrcId;
    private String locationDestId;
    private String returnPickingTypeId;
    private String createUid;
    private Timestamp createDate;
    private String writeUid;
    private Timestamp writeDate;

    public String getDestLocation() {
        return destLocation;
    }

    public void setDestLocation(String destLocation) {
        this.destLocation = destLocation;
    }

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true, length = 36)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name", nullable = false, insertable = true, updatable = true, length = 60)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "code", nullable = false, insertable = true, updatable = true, length = 60)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public BigDecimal getWarehouse_id() {
        return warehouse_id;
    }

    public void setWarehouse_id(BigDecimal warehouse_id) {
        this.warehouse_id = warehouse_id;
    }

    public String getLocation_src_id() {
        return location_src_id;
    }

    public void setLocation_src_id(String location_src_id) {
        this.location_src_id = location_src_id;
    }

    public String getLocation_dest_id() {
        return location_dest_id;
    }

    public void setLocation_dest_id(String location_dest_id) {
        this.location_dest_id = location_dest_id;
    }

    public String getReturn_picking_type_id() {
        return return_picking_type_id;
    }

    public void setReturn_picking_type_id(String return_picking_type_id) {
        this.return_picking_type_id = return_picking_type_id;
    }

    public String getCreate_uid() {
        return create_uid;
    }

    public void setCreate_uid(String create_uid) {
        this.create_uid = create_uid;
    }

    public String getCreate_date() {
        return create_date;
    }

    public void setCreate_date(String create_date) {
        this.create_date = create_date;
    }

    public String getWrite_uid() {
        return write_uid;
    }

    public void setWrite_uid(String write_uid) {
        this.write_uid = write_uid;
    }

    public String getWrite_date() {
        return write_date;
    }

    public void setWrite_date(String write_date) {
        this.write_date = write_date;
    }

    public String toString() {
        return "StockPickingType [id=" + id + ", code=" + code + ", name=" + name + ", warehouse_id=" + warehouse_id
                + ", location_src_id=" + location_src_id +", location_dest_id=" + location_dest_id +", return_picking_type_id=" + return_picking_type_id +
                ", create_uid=" + create_uid +", create_date=" + create_date +", write_uid=" + write_uid +", write_date=" + write_date +"]";
    }

    @Basic
    @Column(name = "warehouse_id", nullable = true, insertable = true, updatable = true, length = 36)
    public String getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(String warehouseId) {
        this.warehouseId = warehouseId;
    }

    @Basic
    @Column(name = "location_src_id", nullable = true, insertable = true, updatable = true, length = 36)
    public String getLocationSrcId() {
        return locationSrcId;
    }

    public void setLocationSrcId(String locationSrcId) {
        this.locationSrcId = locationSrcId;
    }

    @Basic
    @Column(name = "location_dest_id", nullable = true, insertable = true, updatable = true, length = 36)
    public String getLocationDestId() {
        return locationDestId;
    }

    public void setLocationDestId(String locationDestId) {
        this.locationDestId = locationDestId;
    }

    @Basic
    @Column(name = "return_picking_type_id", nullable = true, insertable = true, updatable = true, length = 36)
    public String getReturnPickingTypeId() {
        return returnPickingTypeId;
    }

    public void setReturnPickingTypeId(String returnPickingTypeId) {
        this.returnPickingTypeId = returnPickingTypeId;
    }

    @Basic
    @Column(name = "create_uid", nullable = true, insertable = true, updatable = true, length = 20)
    public String getCreateUid() {
        return createUid;
    }

    public void setCreateUid(String createUid) {
        this.createUid = createUid;
    }

    @Basic
    @Column(name = "create_date", nullable = false, insertable = true, updatable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "write_uid", nullable = true, insertable = true, updatable = true, length = 20)
    public String getWriteUid() {
        return writeUid;
    }

    public void setWriteUid(String writeUid) {
        this.writeUid = writeUid;
    }

    @Basic
    @Column(name = "write_date", nullable = false, insertable = true, updatable = true)
    public Timestamp getWriteDate() {
        return writeDate;
    }

    public void setWriteDate(Timestamp writeDate) {
        this.writeDate = writeDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StockPickingType that = (StockPickingType) o;

        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createUid != null ? !createUid.equals(that.createUid) : that.createUid != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (locationDestId != null ? !locationDestId.equals(that.locationDestId) : that.locationDestId != null)
            return false;
        if (locationSrcId != null ? !locationSrcId.equals(that.locationSrcId) : that.locationSrcId != null)
            return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (returnPickingTypeId != null ? !returnPickingTypeId.equals(that.returnPickingTypeId) : that.returnPickingTypeId != null)
            return false;
        if (warehouseId != null ? !warehouseId.equals(that.warehouseId) : that.warehouseId != null) return false;
        if (writeDate != null ? !writeDate.equals(that.writeDate) : that.writeDate != null) return false;
        if (writeUid != null ? !writeUid.equals(that.writeUid) : that.writeUid != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (warehouseId != null ? warehouseId.hashCode() : 0);
        result = 31 * result + (locationSrcId != null ? locationSrcId.hashCode() : 0);
        result = 31 * result + (locationDestId != null ? locationDestId.hashCode() : 0);
        result = 31 * result + (returnPickingTypeId != null ? returnPickingTypeId.hashCode() : 0);
        result = 31 * result + (createUid != null ? createUid.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (writeUid != null ? writeUid.hashCode() : 0);
        result = 31 * result + (writeDate != null ? writeDate.hashCode() : 0);
        return result;
    }
}
